package com.aspose.cells;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;

class zatl {
   private static com.aspose.cells.a.d.zb N = new com.aspose.cells.a.d.zb();
   private static HashMap O = null;
   private static Object P = new Object();
   private zbuz Q;
   public com.aspose.cells.a.d.zb a;
   public zan b;
   public int c;
   public int d;
   public int e;
   public int f;
   public float g;
   public float h;
   public float i;
   public float j;
   public int k;
   public int l;
   public Color m;
   public boolean n;
   public ArrayList o;
   public int p;
   public int q;
   public float r;
   public com.aspose.cells.a.d.zb s;
   public com.aspose.cells.a.d.ze t;
   public String u;
   public com.aspose.cells.b.a.b.zq v;
   public float w;
   public float x;
   private zgd R;
   public Cells y;
   public boolean z;
   public String A;
   public com.aspose.cells.a.d.zb B;
   public com.aspose.cells.a.d.zb C;
   public zga D;
   public ArrayList E;
   public double[] F;
   public com.aspose.cells.a.d.zb G;
   public com.aspose.cells.a.d.zb H;
   public com.aspose.cells.a.d.zb I;
   public com.aspose.cells.a.d.zb J;
   public float K;
   public boolean L;
   public HashMap M = new HashMap();
   private com.aspose.cells.a.d.zfj S;
   private static String[] T = new String[]{"ColorScaledStyle", "DataBarStyle", "IconSetStyle"};

   public zatl(zbuz var1) {
      this.Q = var1;
   }

   private void l() {
      this.u = null;
      this.K = 1.0F;
   }

   public void a() throws Exception {
      this.n();
      this.l();
   }

   void a(float var1, float var2, com.aspose.cells.b.a.b.zq var3, zagg var4) {
      this.j = var2;
      this.i = var1;
      float var5 = var1;
      float var6 = var2;
      float var7 = 0.0F;
      Color var8 = Color.a(255, (Color)this.y.h().w());
      com.aspose.cells.a.d.zs var9 = new com.aspose.cells.a.d.zs(var8, 1.5F * (float)this.F[0]);
      com.aspose.cells.a.d.zs var10 = new com.aspose.cells.a.d.zs(var8, 1.0F * (float)this.F[0]);
      var9.i = 0;
      var10.i = 0;
      var9.c = 2;
      var9.d = 2;
      var10.a(new float[]{1.0F, 1.0F});

      int var11;
      for(var11 = this.d; var11 <= this.f; ++var11) {
         var7 += (float)this.F[0] * (float)var4.b(var11) * 72.0F;
      }

      float var12;
      com.aspose.cells.a.d.zk var13;
      for(var11 = this.c; var11 <= this.e; ++var11) {
         var12 = (float)this.F[1] * (float)this.y.getRowHeight(var11);
         if (var12 != 0.0F) {
            var13 = new com.aspose.cells.a.d.zk(new com.aspose.cells.b.a.b.zo(var1, (float)com.aspose.cells.b.a.zq.b((double)var6, 3)), new com.aspose.cells.b.a.b.zo(var1 + var7, (float)com.aspose.cells.b.a.zq.b((double)var6, 3)));
            if (var11 == this.c) {
               var13.c = var9;
            } else {
               var13.c = var10;
            }

            this.J.a((com.aspose.cells.a.d.zl)var13);
            var6 += var12;
            if (var11 == this.e) {
               var13 = new com.aspose.cells.a.d.zk(new com.aspose.cells.b.a.b.zo(var1, (float)com.aspose.cells.b.a.zq.b((double)var6, 3)), new com.aspose.cells.b.a.b.zo(var1 + var7, (float)com.aspose.cells.b.a.zq.b((double)var6, 3)));
               var13.c = var9;
               this.J.a((com.aspose.cells.a.d.zl)var13);
            }
         }
      }

      for(var11 = this.d; var11 <= this.f; ++var11) {
         var12 = (float)this.F[0] * (float)var4.b(var11) * 72.0F;
         if (var12 != 0.0F) {
            if (this.y.h().getDisplayRightToLeft()) {
               var13 = new com.aspose.cells.a.d.zk(new com.aspose.cells.b.a.b.zo(var3.l() - (var5 - var3.j()) + 1.0F, (float)com.aspose.cells.b.a.zq.b((double)var2, 3)), new com.aspose.cells.b.a.b.zo(var3.l() - (var5 - var3.j()) + 1.0F, (float)com.aspose.cells.b.a.zq.b((double)(var2 + var6), 3)));
            } else {
               var13 = new com.aspose.cells.a.d.zk(new com.aspose.cells.b.a.b.zo(var5, (float)com.aspose.cells.b.a.zq.b((double)var2, 3)), new com.aspose.cells.b.a.b.zo(var5, (float)com.aspose.cells.b.a.zq.b((double)(var2 + var6), 3)));
            }

            if (var11 == this.d) {
               var13.c = var9;
            } else {
               var13.c = var10;
            }

            this.J.a((com.aspose.cells.a.d.zl)var13);
            var5 += var12;
            if (var11 == this.f) {
               if (this.y.h().getDisplayRightToLeft()) {
                  var13 = new com.aspose.cells.a.d.zk(new com.aspose.cells.b.a.b.zo(var3.l() - (var5 - var3.j()) + 1.0F, (float)com.aspose.cells.b.a.zq.b((double)var2, 3)), new com.aspose.cells.b.a.b.zo(var3.l() - (var5 - var3.j()) + 1.0F, (float)com.aspose.cells.b.a.zq.b((double)(var2 + var6), 3)));
               } else {
                  var13 = new com.aspose.cells.a.d.zk(new com.aspose.cells.b.a.b.zo(var5, (float)com.aspose.cells.b.a.zq.b((double)var2, 3)), new com.aspose.cells.b.a.b.zo(var5, (float)com.aspose.cells.b.a.zq.b((double)(var2 + var6), 3)));
               }

               var13.c = var9;
               this.J.a((com.aspose.cells.a.d.zl)var13);
            }
         }
      }

      this.a.a((com.aspose.cells.a.d.zl)this.J);
   }

   void a(com.aspose.cells.b.a.b.zq var1) {
      Color var2 = Color.a(255, (Color)this.D.c().getForegroundColor());
      Color var3 = Color.a(255, (Color)this.D.c().getBackgroundColor());
      if (this.D.c().a.a()) {
         var3 = Color.getWhite();
      }

      ArrayList var4 = com.aspose.cells.a.d.zh.a(var2, var3, var1, this.D.c().v(), this.D.c().w());
      com.aspose.cells.a.d.zb var5 = new com.aspose.cells.a.d.zb();
      Iterator var6;
      com.aspose.cells.a.d.zn var7;
      if (this.r != 0.0F && this.D.d() && this.D.m() == 1 && this.D.l() == 1 && this.D.q()) {
         var6 = var4.iterator();

         while(var6.hasNext()) {
            var7 = (com.aspose.cells.a.d.zn)var6.next();
            var5.a((com.aspose.cells.a.d.zl)var7);
         }

         this.I.a((com.aspose.cells.a.d.zl)this.a(var5, this.i, this.j + this.g));
      } else {
         if (this.L) {
            var5.a((com.aspose.cells.a.d.zam)null);
         } else {
            var5.a(new com.aspose.cells.a.d.zam(var1, this.y.h().getDisplayRightToLeft()));
         }

         var5.a(new com.aspose.cells.a.d.zn(var1));
         var6 = var4.iterator();

         while(var6.hasNext()) {
            var7 = (com.aspose.cells.a.d.zn)var6.next();
            var5.a((com.aspose.cells.a.d.zl)var7);
         }

         this.H.a((com.aspose.cells.a.d.zl)var5);
      }

   }

   private com.aspose.cells.b.a.b.zu a(Color var1) {
      HashMap var2 = this.Q.e;
      synchronized(this.Q.e) {
         com.aspose.cells.b.a.b.zu var3 = (com.aspose.cells.b.a.b.zu)this.Q.e.get(var1.toArgb());
         if (var3 == null) {
            var3 = new com.aspose.cells.b.a.b.zu(var1);
            this.Q.e.put(var1.toArgb(), var3);
         }

         return var3;
      }
   }

   com.aspose.cells.a.d.zb a(com.aspose.cells.a.d.zb var1, float var2, float var3) {
      if (var1.a() == null) {
         var1.a(new com.aspose.cells.b.a.b.a.zi());
      }

      float var4 = (float)((double)(-this.r) * 0.017453292519943295D);
      float var5 = (float)(1.0D / Math.tan((double)var4));
      var1.a().c(var5, 0.0F);
      com.aspose.cells.a.d.zb var6 = new com.aspose.cells.a.d.zb();
      var6.a(new com.aspose.cells.b.a.b.a.zi(1.0F, 0.0F, 0.0F, 1.0F, -var5 * var3, 0.0F));
      var6.a((com.aspose.cells.a.d.zl)var1);
      return var6;
   }

   void b(com.aspose.cells.b.a.b.zq var1) {
      com.aspose.cells.a.d.zn var2 = null;
      Color var3 = Color.a(255, (Color)this.m);
      var2 = com.aspose.cells.a.d.zn.b(var1);
      if (this.D.u()) {
         var3 = Color.a(255, (Color)Color.getWhite());
      } else if ((this.D.c().getPattern() == 0 || this.D.c().b.a()) && this.m.getA() == 0 && this.m.getR() == 0 && this.m.getG() == 0 && this.m.getB() == 0) {
         if (!this.y.h().getPageSetup().getPrintGridlines() || !this.D.n() && this.D.l() == 1 && this.D.m() == 1) {
            return;
         }

         var3 = Color.a(255, (Color)Color.getWhite());
      } else if (!(this.t instanceof com.aspose.cells.a.d.zat) && (var3.getR() & 255) == 255 && (var3.getG() & 255) == 255 && (var3.getB() & 255) == 255 && !this.y.h().getPageSetup().getPrintGridlines()) {
         ;
      }

      var2.a((com.aspose.cells.b.a.b.zc)this.a(var3));
      com.aspose.cells.a.d.zb var4 = new com.aspose.cells.a.d.zb();
      var4.a((com.aspose.cells.a.d.zl)var2);
      if (this.r != 0.0F && this.D.d() && this.D.m() == 1 && this.D.l() == 1 && this.D.q()) {
         this.I.a((com.aspose.cells.a.d.zl)this.a(var4, this.i, this.j + this.g));
      } else {
         var4.a((com.aspose.cells.a.d.zam)null);
         this.H.a((com.aspose.cells.a.d.zl)var4);
      }

   }

   void c(com.aspose.cells.b.a.b.zq var1) {
      com.aspose.cells.a.d.zn var2 = com.aspose.cells.a.d.zn.b(var1);
      Color var3 = Color.getWhite();
      int var4 = zatm.a(this.D.c().getPattern());
      Color var5 = Color.a(255, (Color)this.D.c().getForegroundColor());
      Color var6 = Color.a(255, (Color)this.D.c().getBackgroundColor());
      if (this.D.c().a.a()) {
         var6 = Color.getWhite();
      }

      com.aspose.cells.b.a.b.a.zg var7 = new com.aspose.cells.b.a.b.a.zg(var4, var5, var6);
      var2.a((com.aspose.cells.b.a.b.zc)var7);
      com.aspose.cells.a.d.zb var8 = new com.aspose.cells.a.d.zb();
      var8.a((com.aspose.cells.a.d.zl)var2);
      if (this.r != 0.0F && this.D.d() && this.D.m() == 1 && this.D.l() == 1 && this.D.q()) {
         this.I.a((com.aspose.cells.a.d.zl)this.a(var8, this.i, this.j + this.g));
      } else {
         if (this.L) {
            var8.a((com.aspose.cells.a.d.zam)null);
         } else {
            var8.a(new com.aspose.cells.a.d.zam(var1, this.y.h().getDisplayRightToLeft()));
         }

         this.H.a((com.aspose.cells.a.d.zl)var8);
      }

   }

   void b() {
      if (!this.n) {
         com.aspose.cells.b.a.b.zq var1;
         if (this.D.c().getPattern() == 0 && !this.D.u()) {
            var1 = new com.aspose.cells.b.a.b.zq(this.i + 0.5F * (float)this.F[0], this.j + 0.5F * (float)this.F[0], this.h - 1.0F * (float)this.F[0], this.g - 1.0F * (float)this.F[0]);
         } else {
            var1 = new com.aspose.cells.b.a.b.zq(this.i, this.j, this.h, this.g);
         }

         if (this.D.c().isGradient()) {
            this.a(var1);
         } else if (this.D.c().getPattern() != 0 && this.D.c().getPattern() != 1) {
            this.c(var1);
         } else {
            this.b(var1);
         }
      }
   }

   void c() {
      this.G = new com.aspose.cells.a.d.zb();
   }

   void d() {
      this.H = new com.aspose.cells.a.d.zb();
   }

   void e() {
      this.J = new com.aspose.cells.a.d.zb();
      this.s = new com.aspose.cells.a.d.zb();
      this.I = new com.aspose.cells.a.d.zb();
      this.M = new HashMap();
   }

   void a(float var1, float var2) {
      this.s.a((com.aspose.cells.a.d.zl)this.I);
      Iterator var3 = this.M.keySet().iterator();

      while(var3.hasNext()) {
         Object var4 = var3.next();
         zdb var5 = (zdb)this.M.get(var4);
         if (var5 != null && var5.a() != null && var5.a() != N) {
            this.s.a((com.aspose.cells.a.d.zl)var5.a());
         }
      }

      this.a.a((com.aspose.cells.a.d.zl)this.s);
      this.M.clear();
   }

   void f() {
      this.a.a((com.aspose.cells.a.d.zl)this.H);
   }

   void g() {
      this.a.a((com.aspose.cells.a.d.zl)this.G);
   }

   void h() {
      if (this.D.c != null && this.D.c.getLineStyle() != 0 || this.D.d != null && this.D.d.getLineStyle() != 0) {
         this.b(this.D.c().getBorders());
         this.a(this.o, this.D.j(), this.D.k(), this.i, this.j, this.h, this.g);
      }

      int var1;
      if (this.D.f < 0) {
         var1 = this.D.k() - (this.D.m() - 1);
         if (var1 < 0) {
            var1 = 0;
         }
      } else {
         var1 = this.D.k();
      }

      boolean var2 = false;
      float var3 = this.j;

      for(int var4 = this.D.j(); var4 < this.D.j() + this.D.l(); ++var4) {
         float var5 = (float)(this.y.getRowHeight(var4) * this.F[1]);
         float var6 = this.i;

         for(int var7 = var1; var7 < var1 + this.D.m() && var7 <= 16383; ++var7) {
            float var8 = (float)(this.y.c.b(var7) * 72.0D * this.F[0]);
            BorderCollection var9 = new BorderCollection(new Style(this.y.r()));
            if (this.D.n() && !this.D.j) {
               BorderCollection var12;
               if (this.D.c() != null && this.D.c().d() != null) {
                  var12 = this.D.c().getBorders();
                  if (var4 == this.D.o().a) {
                     var9.getByBorderType(4).setColor(var12.getByBorderType(4).getColor());
                     var9.getByBorderType(4).setLineStyle(var12.getByBorderType(4).getLineStyle());
                  }

                  if (var7 == this.D.o().b) {
                     var9.getByBorderType(1).setColor(var12.getByBorderType(1).getColor());
                     var9.getByBorderType(1).setLineStyle(var12.getByBorderType(1).getLineStyle());
                  }
               }

               if (this.D.i != null && this.D.i.d() != null) {
                  var12 = this.D.i.getBorders();
                  if (var7 == this.D.o().d) {
                     var9.getByBorderType(2).setColor(var12.getByBorderType(2).getColor());
                     var9.getByBorderType(2).setLineStyle(var12.getByBorderType(2).getLineStyle());
                  }

                  if (var4 == this.D.o().c) {
                     var9.getByBorderType(8).setColor(var12.getByBorderType(8).getColor());
                     var9.getByBorderType(8).setLineStyle(var12.getByBorderType(8).getLineStyle());
                  }
               }
            } else if (this.D.l() == 1 && this.D.m() == 1 && !this.D.n()) {
               if (this.D.c() != null && this.D.c().d() != null) {
                  var9.a(this.D.c().getBorders());
               }
            } else {
               Style var10 = this.y.b(var4, var7, false);
               if (var10 != null && var10.d() != null) {
                  var9.a(var10.getBorders());
               }
            }

            int var11;
            if (this.D.m() > 1) {
               if (var7 != var1) {
                  var11 = (var4 << 11) + (var7 << 1) + 1;
                  this.M.put(var11, new zdb(N, 0, Color.getEmpty()));
                  var9.getByBorderType(1).setLineStyle(0);
               }

               if (var7 != var1 + this.D.m() - 1) {
                  var11 = (var4 << 11) + (var7 + 1 << 1) + 1;
                  this.M.put(var11, new zdb(N, 0, Color.getEmpty()));
                  var9.getByBorderType(2).setLineStyle(0);
               }
            }

            if (this.D.l() > 1) {
               if (var4 != this.D.j()) {
                  var11 = (var4 << 11) + (var7 << 1) + 0;
                  this.M.put(var11, new zdb(N, 0, Color.getEmpty()));
                  var9.getByBorderType(4).setLineStyle(0);
               }

               if (var4 != this.D.j() + this.D.l() - 1) {
                  var11 = (var4 + 1 << 11) + (var7 << 1) + 0;
                  this.M.put(var11, new zdb(N, 0, Color.getEmpty()));
                  var9.getByBorderType(8).setLineStyle(0);
               }
            }

            this.a(var9);
            if (var4 == this.D.j() && var7 == this.D.k() || this.D.n() || this.D.b()) {
               if (this.y.h().getDisplayRightToLeft()) {
                  this.a(this.o, var4, var7, var6 + this.h - var8, var3, var8, var5);
               } else {
                  this.a(this.o, var4, var7, var6, var3, var8, var5);
               }
            }

            if (this.y.h().getDisplayRightToLeft()) {
               var6 -= var8;
            } else {
               var6 += var8;
            }
         }

         var3 += var5;
         if (this.D.l() == 1) {
            return;
         }
      }

   }

   private void a(Border var1, int var2) {
      float var3 = 2.0F;
      switch(var1.getLineStyle()) {
      case 1:
         var3 *= 0.5F;
      case 2:
      case 8:
      case 10:
      case 12:
      case 13:
      default:
         break;
      case 3:
         var3 *= 0.5F;
         break;
      case 4:
         var3 *= 0.5F;
         break;
      case 5:
         var3 *= 1.5F;
         break;
      case 6:
         var3 *= 0.5F;
         break;
      case 7:
         var3 *= 0.25F;
         break;
      case 9:
         var3 *= 0.5F;
         break;
      case 11:
         var3 *= 0.5F;
      }

      ArrayList var5 = new ArrayList(3);
      com.aspose.cells.b.a.a.ze.a(var5, (Object)((float)((double)var3 * this.F[1])));
      Color var6 = this.a(var1);
      com.aspose.cells.b.a.a.ze.a(var5, (Object)var6);
      com.aspose.cells.b.a.a.ze.a(var5, (Object)var1.getLineStyle());
      this.o.set(var2, var5);
   }

   private Color a(Border var1) {
      Color var2;
      if (var1.a.a()) {
         var2 = Color.a(255, (Color)this.y.h().w());
      } else {
         var2 = Color.a(255, (Color)var1.getColor());
      }

      return var2;
   }

   private ArrayList a(BorderCollection var1) {
      this.o = new ArrayList(6);

      for(int var2 = 0; var2 < 6; ++var2) {
         com.aspose.cells.b.a.a.ze.a(this.o, (Object)null);
      }

      if (var1.getByBorderType(4).getLineStyle() != 0) {
         this.a(var1.getByBorderType(4), 1);
      }

      if (var1.getByBorderType(8).getLineStyle() != 0) {
         this.a(var1.getByBorderType(8), 3);
      }

      if (var1.getByBorderType(1).getLineStyle() != 0) {
         this.a(var1.getByBorderType(1), 0);
      }

      if (var1.getByBorderType(2).getLineStyle() != 0) {
         this.a(var1.getByBorderType(2), 2);
      }

      return this.o;
   }

   private ArrayList b(BorderCollection var1) {
      this.o = new ArrayList(6);

      for(int var2 = 0; var2 < 6; ++var2) {
         com.aspose.cells.b.a.a.ze.a(this.o, (Object)null);
      }

      if (var1.getByBorderType(32).getLineStyle() != 0) {
         this.a(var1.getByBorderType(32), 4);
      }

      if (var1.getByBorderType(16).getLineStyle() != 0) {
         this.a(var1.getByBorderType(16), 5);
      }

      return this.o;
   }

   private void a(com.aspose.cells.a.d.zb var1, int var2, ArrayList var3, int var4, int var5, float var6, float var7, float var8, float var9, boolean var10) {
      if (var3 != null) {
         Color var11 = (Color)((Color)var3.get(1));
         float var12 = (Float)var3.get(0);
         if (this.n) {
            var11 = Color.getBlack();
         }

         com.aspose.cells.a.d.zs var13 = new com.aspose.cells.a.d.zs(var11, var12);
         var13.h = 1.0F;
         float var14 = 2.0F;
         float var15 = 1.0F;
         float var16 = 1.0F;
         switch((Integer)((Integer)var3.get(2))) {
         case 1:
         case 2:
         case 5:
            var13.g = 0;
            var13.a(0, 0, 0);
            break;
         case 3:
            var13.g = 5;
            var13.a(new float[]{var14, var16});
            var13.k = var6 % (var14 + var16);
            break;
         case 4:
            var13.g = 5;
            var13.a(new float[]{var15, var16});
            var13.k = var6 % (var15 + var16);
            break;
         case 6:
            var13.g = 0;
            var13.a(0, 0, 0);
            break;
         case 7:
            var13.g = 0;
            var13.a(0, 0, 0);
            break;
         case 8:
            var13.g = 5;
            var13.a(new float[]{var14, var16});
            var13.k = var6 % (var14 + var16);
            break;
         case 9:
            var13.g = 5;
            var13.a(new float[]{var14, var16, var15, var16});
            var13.k = var6 % (var14 + var16 + var15 + var16);
            break;
         case 10:
            var13.g = 5;
            var13.a(new float[]{var14, var16, var15, var16});
            var13.k = var6 % (var14 + var16 + var15 + var16);
            break;
         case 11:
            var13.g = 5;
            var13.a(new float[]{var14, var16, var15, var16, var15, var16});
            var13.k = var6 % (var14 + var16 + var15 + var16 + var15 + var16);
            break;
         case 12:
            var13.g = 5;
            var13.a(new float[]{var14, var16, var15, var16, var15, var16});
            var13.k = var6 % (var14 + var16 + var15 + var16 + var15 + var16);
            break;
         case 13:
            var13.g = 5;
            var13.a(new float[]{var14, var16, var15, var16});
            var13.k = var6 % (var14 + var16 + var15 + var16);
         }

         boolean var30 = false;
         float var17;
         float var18;
         float var19;
         float var20;
         float var22;
         float var23;
         float var24;
         float var25;
         int var37;
         if ((Integer)((Integer)var3.get(2)) == 6) {
            float var29 = 0.0F;
            float var28 = 0.0F;
            float var27 = 0.0F;
            float var26 = 0.0F;
            var20 = 0.0F;
            var19 = 0.0F;
            var18 = 0.0F;
            var17 = 0.0F;
            var25 = 0.0F;
            var24 = 0.0F;
            var23 = 0.0F;
            var22 = 0.0F;
            com.aspose.cells.a.d.zn var31 = new com.aspose.cells.a.d.zn();
            com.aspose.cells.a.d.zn var32 = new com.aspose.cells.a.d.zn();
            com.aspose.cells.a.d.zn var33 = new com.aspose.cells.a.d.zn();
            com.aspose.cells.a.d.zb var34 = new com.aspose.cells.a.d.zb();
            int var35;
            int var36;
            switch(var2) {
            case 0:
               var37 = (var4 << 11) + (var5 << 1) + 1;
               this.a(var10, var37, var34, (Integer)((Integer)var3.get(2)), var11);
               var17 = zdd.a(this.y, var4, var5, var4, var5 - 1, 4) * (float)this.F[1];
               var20 = zdd.a(this.y, var4, var5, var4, var5 - 1, 8) * (float)this.F[1];
               var22 = zdd.b(this.y, var4, var5, var4, var5 - 1, 4) * (float)this.F[1];
               var25 = zdd.b(this.y, var4, var5, var4, var5 - 1, 8) * (float)this.F[1];
               var27 = zdd.a(this.y, var4, var5, var4, var5 - 1, 4, var4 - 1, var5, 1) * (float)this.F[1];
               var29 = zdd.a(this.y, var4, var5, var4, var5 - 1, 8, var4 + this.D.l(), var5, 1) * (float)this.F[1];
               var31 = com.aspose.cells.a.d.zn.a(new com.aspose.cells.b.a.b.zo(var6 - var12, var7 + var22), new com.aspose.cells.b.a.b.zo(var6 - var12, var7 + var9 - var25));
               var32 = com.aspose.cells.a.d.zn.a(new com.aspose.cells.b.a.b.zo(var6 + var12, var7 + var17), new com.aspose.cells.b.a.b.zo(var6 + var12, var7 + var9 - var20));
               var33 = com.aspose.cells.a.d.zn.a(new com.aspose.cells.b.a.b.zo(var6, var7 + var27), new com.aspose.cells.b.a.b.zo(var6, var7 + var9 - var29));
               break;
            case 1:
               var37 = (var4 << 11) + (var5 << 1) + 0;
               this.a(var10, var37, var34, (Integer)((Integer)var3.get(2)), var11);
               var17 = zdd.a(this.y, var4, var5, var4 - 1, var5, 1) * (float)this.F[0];
               var20 = zdd.a(this.y, var4, var5, var4 - 1, var5, 2) * (float)this.F[0];
               var22 = zdd.b(this.y, var4, var5, var4 - 1, var5, 1) * (float)this.F[0];
               var25 = zdd.b(this.y, var4, var5, var4 - 1, var5, 2) * (float)this.F[0];
               var26 = zdd.a(this.y, var4, var5, var4 - 1, var5, 1, var4, var5 - 1, 4) * (float)this.F[0];
               var28 = zdd.a(this.y, var4, var5, var4 - 1, var5, 2, var4, var5 + this.D.m(), 4) * (float)this.F[0];
               var31 = com.aspose.cells.a.d.zn.a(new com.aspose.cells.b.a.b.zo(var6 + var17, var7 + var12), new com.aspose.cells.b.a.b.zo(var6 + var8 - var20, var7 + var12));
               var32 = com.aspose.cells.a.d.zn.a(new com.aspose.cells.b.a.b.zo(var6 + var22, var7 - var12), new com.aspose.cells.b.a.b.zo(var6 + var8 - var25, var7 - var12));
               var33 = com.aspose.cells.a.d.zn.a(new com.aspose.cells.b.a.b.zo(var6 + var26, var7), new com.aspose.cells.b.a.b.zo(var6 + var8 - var28, var7));
               break;
            case 2:
               var37 = (var4 << 11) + (var5 + 1 << 1) + 1;
               this.a(var10, var37, var34, (Integer)((Integer)var3.get(2)), var11);
               var35 = this.D.m() == 1 ? var5 : var5 + this.D.m() - 1;
               var36 = this.D.l() == 1 ? var4 : var4 + this.D.l() - 1;
               var17 = zdd.a(this.y, var36, var35, var36, var35 + 1, 4) * (float)this.F[1];
               var20 = zdd.a(this.y, var36, var35, var36, var35 + 1, 8) * (float)this.F[1];
               var22 = zdd.b(this.y, var36, var35, var36, var35 + 1, 4) * (float)this.F[1];
               var25 = zdd.b(this.y, var36, var35, var36, var35 + 1, 8) * (float)this.F[1];
               var27 = zdd.a(this.y, var36, var35, var36, var35 + 1, 4, var36 - 1, var35, 2) * (float)this.F[1];
               var29 = zdd.a(this.y, var36, var35, var36, var35 + 1, 8, var36 + 1, var35, 2) * (float)this.F[1];
               var31 = com.aspose.cells.a.d.zn.a(new com.aspose.cells.b.a.b.zo(var6 - var12 + var8, var7 + var22), new com.aspose.cells.b.a.b.zo(var6 - var12 + var8, var7 + var9 - var25));
               var32 = com.aspose.cells.a.d.zn.a(new com.aspose.cells.b.a.b.zo(var6 + var12 + var8, var7 + var17), new com.aspose.cells.b.a.b.zo(var6 + var12 + var8, var7 + var9 - var20));
               var33 = com.aspose.cells.a.d.zn.a(new com.aspose.cells.b.a.b.zo(var6 + var8, var7 + var27), new com.aspose.cells.b.a.b.zo(var6 + var8, var7 + var9 - var29));
               break;
            case 3:
               var37 = (var4 + 1 << 11) + (var5 << 1) + 0;
               this.a(var10, var37, var34, (Integer)((Integer)var3.get(2)), var11);
               var35 = this.D.m() == 1 ? var5 : var5 + this.D.m() - 1;
               var36 = this.D.l() == 1 ? var4 : var4 + this.D.l() - 1;
               var17 = zdd.a(this.y, var36, var35, var36 + 1, var35, 1) * (float)this.F[0];
               var20 = zdd.a(this.y, var36, var35, var36 + 1, var35, 2) * (float)this.F[0];
               var22 = zdd.b(this.y, var36, var35, var36 + 1, var35, 1) * (float)this.F[0];
               var25 = zdd.b(this.y, var36, var35, var36 + 1, var35, 2) * (float)this.F[0];
               var26 = zdd.a(this.y, var36, var35, var36 + 1, var35, 1, var36, var35 - 1, 8) * (float)this.F[0];
               var28 = zdd.a(this.y, var36, var35, var36 + 1, var35, 2, var36, var35 + this.D.m(), 8) * (float)this.F[0];
               var31 = com.aspose.cells.a.d.zn.a(new com.aspose.cells.b.a.b.zo(var6 + var17, var7 + var9 - var12), new com.aspose.cells.b.a.b.zo(var6 + var8 - var20, var7 + var9 - var12));
               var32 = com.aspose.cells.a.d.zn.a(new com.aspose.cells.b.a.b.zo(var6 + var22, var7 + var9 + var12), new com.aspose.cells.b.a.b.zo(var6 + var8 - var25, var7 + var9 + var12));
               var33 = com.aspose.cells.a.d.zn.a(new com.aspose.cells.b.a.b.zo(var6 + var26, var7 + var9), new com.aspose.cells.b.a.b.zo(var6 + var8 - var28, var7 + var9));
            }

            var31.a = var13;
            var32.a = var13;
            com.aspose.cells.a.d.zs var39 = new com.aspose.cells.a.d.zs(Color.getWhite(), var12);
            var39.a(0, 0, 0);
            var33.a = var39;
            var34.a((com.aspose.cells.a.d.zl)var31);
            var34.a((com.aspose.cells.a.d.zl)var32);
            var34.a((com.aspose.cells.a.d.zl)var33);
            if (var10) {
               var1.a((com.aspose.cells.a.d.zl)var34);
            }
         } else {
            com.aspose.cells.a.d.zk var38 = null;
            var20 = 0.0F;
            var19 = 0.0F;
            var18 = 0.0F;
            var17 = 0.0F;
            var25 = 0.0F;
            var24 = 0.0F;
            var23 = 0.0F;
            var22 = 0.0F;
            switch(var2) {
            case 0:
               var37 = (var4 << 11) + (var5 << 1) + 1;
               if (this.y.h().getDisplayRightToLeft()) {
                  var38 = new com.aspose.cells.a.d.zk(new com.aspose.cells.b.a.b.zo((float)com.aspose.cells.b.a.zq.b((double)(var6 + var8), 3), var7 + var17), new com.aspose.cells.b.a.b.zo((float)com.aspose.cells.b.a.zq.b((double)(var6 + var8), 3), var7 + var9 - var20));
               } else {
                  var38 = new com.aspose.cells.a.d.zk(new com.aspose.cells.b.a.b.zo((float)com.aspose.cells.b.a.zq.b((double)var6, 3), var7 + var17), new com.aspose.cells.b.a.b.zo((float)com.aspose.cells.b.a.zq.b((double)var6, 3), var7 + var9 - var20));
               }

               this.a(var10, var37, var38, (Integer)((Integer)var3.get(2)), var11);
               break;
            case 1:
               var37 = (var4 << 11) + (var5 << 1) + 0;
               var38 = new com.aspose.cells.a.d.zk(new com.aspose.cells.b.a.b.zo(var6 + var18, (float)com.aspose.cells.b.a.zq.b((double)var7, 3)), new com.aspose.cells.b.a.b.zo(var6 + var8 - var19, (float)com.aspose.cells.b.a.zq.b((double)var7, 3)));
               this.a(var10, var37, var38, (Integer)((Integer)var3.get(2)), var11);
               break;
            case 2:
               var37 = (var4 << 11) + (var5 + 1 << 1) + 1;
               if (this.y.h().getDisplayRightToLeft()) {
                  var38 = new com.aspose.cells.a.d.zk(new com.aspose.cells.b.a.b.zo((float)com.aspose.cells.b.a.zq.b((double)var6, 3), var7 + var17), new com.aspose.cells.b.a.b.zo((float)com.aspose.cells.b.a.zq.b((double)var6, 3), var7 + var9 - var20));
               } else {
                  var38 = new com.aspose.cells.a.d.zk(new com.aspose.cells.b.a.b.zo((float)com.aspose.cells.b.a.zq.b((double)(var6 + var8), 3), var7 + var17), new com.aspose.cells.b.a.b.zo((float)com.aspose.cells.b.a.zq.b((double)(var6 + var8), 3), var7 + var9 - var20));
               }

               this.a(var10, var37, var38, (Integer)((Integer)var3.get(2)), var11);
               break;
            case 3:
               var37 = (var4 + 1 << 11) + (var5 << 1) + 0;
               var38 = new com.aspose.cells.a.d.zk(new com.aspose.cells.b.a.b.zo(var6 + var18, (float)com.aspose.cells.b.a.zq.b((double)(var7 + var9), 3)), new com.aspose.cells.b.a.b.zo(var6 + var8 - var19, (float)com.aspose.cells.b.a.zq.b((double)(var7 + var9), 3)));
               this.a(var10, var37, var38, (Integer)((Integer)var3.get(2)), var11);
               break;
            case 4:
               var37 = -((var4 + 1 << 11) + (var5 << 1) + 0);
               var38 = new com.aspose.cells.a.d.zk(new com.aspose.cells.b.a.b.zo(var6, var7 + var9), new com.aspose.cells.b.a.b.zo(var6 + var8, var7));
               this.a(var10, var37, var38, (Integer)((Integer)var3.get(2)), var11);
               break;
            case 5:
               var37 = -((var4 + 1 << 11) + (var5 << 1) + 1);
               var38 = new com.aspose.cells.a.d.zk(new com.aspose.cells.b.a.b.zo(var6, var7), new com.aspose.cells.b.a.b.zo(var6 + var8, var7 + var9));
               this.a(var10, var37, var38, (Integer)((Integer)var3.get(2)), var11);
            }

            if (var38 != null) {
               var38.c = var13;
               if (var10) {
                  var1.a((com.aspose.cells.a.d.zl)var38);
               }
            }
         }

      }
   }

   private void a(ArrayList var1, int var2, int var3, float var4, float var5, float var6, float var7) {
      int var8 = -1;
      float[] var9 = new float[6];
      if (var1 != null) {
         if (this.r != 0.0F && this.r != 90.0F && this.r != -90.0F && this.D.r() != null && this.D.r().size() != 0 && !this.D.n()) {
            com.aspose.cells.a.d.zb var15 = new com.aspose.cells.a.d.zb();
            float var16 = (float)((double)(-this.r) * 0.017453292519943295D);
            float var12 = (float)(1.0D / Math.tan((double)var16));
            var15.a(new com.aspose.cells.b.a.b.a.zi());
            var15.a().c(var12, 0.0F);
            Iterator var13 = var1.iterator();

            while(var13.hasNext()) {
               ArrayList var14 = (ArrayList)var13.next();
               ++var8;
               this.a(var15, var8, var14, var2, var3, 0.0F, 0.0F, var6, var7, true);
            }

            com.aspose.cells.a.d.zb var17 = new com.aspose.cells.a.d.zb();
            var17.a((com.aspose.cells.a.d.zl)var15);
            var17.a(new com.aspose.cells.b.a.b.a.zi(1.0F, 0.0F, 0.0F, 1.0F, var4 + var7 / (float)Math.tan((double)(this.r / 180.0F) * 3.141592653589793D), var5));
            this.I.a((com.aspose.cells.a.d.zl)var17);
         } else {
            Iterator var10 = var1.iterator();

            while(var10.hasNext()) {
               ArrayList var11 = (ArrayList)var10.next();
               ++var8;
               this.a(this.s, var8, var11, var2, var3, var4, var5, var6, var7, false);
            }
         }
      }

   }

   private void m() {
      float var1 = 0.0F;
      float var2 = 0.0F;
      float var3 = 0.0F;
      float var4 = 0.0F;
      this.K = 1.0F;
      var1 = this.R.f;
      var2 = this.R.e;
      if (this.D.c().getShrinkToFit()) {
         this.K = this.a(this.h, this.g, var2, var1);
         var2 *= this.K;
         var1 *= this.K;
      }

      if (this.g <= var1 && this.R.i != null && this.R.i.size() > 1) {
         var4 = this.j;
      } else {
         switch(this.p) {
         case 0:
            var4 = this.j + this.g - var1 - (float)(1.0D * this.F[1]);
            if (this.D.c() != null && this.D.c().d() != null && this.D.c().getBorders().getByBorderType(8).getLineStyle() == 6) {
               --var4;
            }
            break;
         case 1:
            var4 = this.j + (this.g - var1) * 0.5F - (float)(1.0D * this.F[1]);
            break;
         case 2:
         case 4:
         case 5:
         case 6:
         case 7:
         case 8:
         default:
            var4 = this.j + (this.g - var1) * 0.5F;
            break;
         case 3:
         case 9:
            if ((double)(this.g - var1) < 1.0D * this.F[1]) {
               var4 = this.j;
            } else {
               var4 = this.j + (float)(1.0D * this.F[1]);
            }
         }
      }

      if (this.q == 5) {
         this.q = this.D.g();
      }

      if (this.h < var2 && (this.q == 1 || this.q == 2) && this.r != 0.0F) {
         var3 = this.i + 1.0F;
      } else {
         switch(this.q) {
         case 1:
         case 2:
            var3 = this.i + (this.h - var2) * 0.5F;
            break;
         case 3:
         case 6:
         case 7:
            if ((double)(this.h - var2) < 1.0D * this.F[0]) {
               var3 = this.i;
            } else {
               var3 = this.i + (float)(1.0D * this.F[0]);
            }
         case 4:
         case 5:
         default:
            break;
         case 8:
            var3 = this.i + (this.h - var2 - 1.0F);
         }
      }

      this.v = new com.aspose.cells.b.a.b.zq(var3, var4, var2, var1);
   }

   private float a(float var1, float var2, float var3, float var4) {
      float var5;
      if (this.r != 90.0F && this.r != -90.0F) {
         var5 = Math.min(Math.max(var1 - 2.0F, 1.0F) / var3, var2 / var4);
      } else {
         var5 = Math.min(var1 / var4, Math.max(var2 - 2.0F, 1.0F) / var3);
      }

      return Math.min(var5, 1.0F);
   }

   public void a(com.aspose.cells.a.d.zb var1) {
      float var2 = 0.0F;
      float var3 = 0.0F;
      double var4 = (double)(this.r / 180.0F) * 3.141592653589793D;
      var1.a((com.aspose.cells.b.a.b.a.zi)null);
      if (this.D.d() && !this.D.n()) {
         if (this.r < -1.4E-45F) {
            switch(this.p) {
            case 0:
               var3 = this.j + this.g - this.v.h() * (float)Math.sin(-var4);
               break;
            case 1:
               var3 = this.j + (this.g - this.v.h() * (float)Math.sin(-var4) + this.v.i() * (float)Math.cos(var4)) / 2.0F;
               break;
            case 9:
               var3 = this.j + this.v.i() * (float)Math.cos(var4);
               break;
            default:
               var3 = this.j + this.v.i() * (float)Math.cos(var4);
            }

            switch(this.q) {
            case 1:
            case 2:
               var2 = this.i - (this.g - (var3 - this.j)) / (float)Math.tan(-var4) + (this.h - this.v.i() / (float)Math.sin(-var4)) / 2.0F;
            case 3:
            case 4:
            case 5:
            default:
               break;
            case 6:
            case 7:
               var2 = this.i - (this.g - (var3 - this.j)) / (float)Math.tan(-var4);
               break;
            case 8:
               var2 = this.i - (this.g - (var3 - this.j)) / (float)Math.tan(-var4) + this.h - this.v.i() / (float)Math.sin(-var4);
            }

            var1.a(new com.aspose.cells.b.a.b.a.zi(1.0F * this.K, 0.0F, 0.0F, 1.0F * this.K, 0.0F, 0.0F));
            var1.a().b(var2, var3, 1);
         } else if (this.r > Float.MIN_VALUE) {
            switch(this.p) {
            case 0:
               var3 = this.j + this.g;
               break;
            case 1:
               var3 = this.j + (this.g + this.v.i() * (float)Math.cos(var4) + this.v.h() * (float)Math.sin(var4)) / 2.0F;
               break;
            case 9:
               var3 = this.j + this.v.i() * (float)Math.cos(var4) + this.v.h() * (float)Math.sin(var4);
               break;
            default:
               var3 = this.j + this.g - (this.v.i() * (float)Math.cos(var4) - this.v.h() * (float)Math.sin(var4)) / 2.0F;
            }

            switch(this.q) {
            case 1:
            case 2:
               var2 = this.i + (this.h + this.v.i() / (float)Math.sin(var4)) / 2.0F + (this.g - (var3 - this.j)) / (float)Math.tan(var4);
            case 3:
            case 4:
            case 5:
            default:
               break;
            case 6:
            case 7:
               var2 = this.i + this.v.i() / (float)Math.sin(var4) + (this.g - (var3 - this.j)) / (float)Math.tan(var4);
               break;
            case 8:
               var2 = this.i + this.h + (this.g - (var3 - this.j)) / (float)Math.tan(var4);
            }

            var1.a(new com.aspose.cells.b.a.b.a.zi(1.0F * this.K, 0.0F, 0.0F, 1.0F * this.K, 0.0F, 0.0F));
            var1.a().b(var2, var3, 1);
         }
      } else if (this.r < -1.4E-45F) {
         switch(this.q) {
         case 1:
         case 2:
            var2 = this.i + (this.h - this.v.i() * (float)Math.sin(-var4) - this.v.h() * (float)Math.cos(var4)) / 2.0F;
         case 3:
         case 4:
         case 5:
         default:
            break;
         case 6:
         case 7:
            var2 = this.i;
            break;
         case 8:
            var2 = this.i + this.h - this.v.i() * (float)Math.sin(-var4) - this.v.h() * (float)Math.cos(var4);
         }

         switch(this.p) {
         case 0:
            var3 = this.j + this.g - this.v.h() * (float)Math.sin(-var4);
            break;
         case 1:
            var3 = this.j + (this.g - this.v.h() * (float)Math.sin(-var4) + this.v.i() * (float)Math.cos(var4)) / 2.0F;
            break;
         case 9:
            var3 = this.j + this.v.i() * (float)Math.cos(var4);
            break;
         default:
            var3 = this.j + this.v.i() * (float)Math.cos(var4);
         }

         var1.a(new com.aspose.cells.b.a.b.a.zi(1.0F * this.K, 0.0F, 0.0F, 1.0F * this.K, 0.0F, 0.0F));
         var1.a().b(var2, var3, 1);
      } else if (this.r > Float.MIN_VALUE) {
         switch(this.q) {
         case 1:
         case 2:
            var2 = this.i + (this.h - this.v.h() * (float)Math.cos(var4) + this.v.i() * (float)Math.sin(var4)) / 2.0F;
         case 3:
         case 4:
         case 5:
         default:
            break;
         case 6:
         case 7:
            var2 = this.i + this.v.i() * (float)Math.sin(var4);
            break;
         case 8:
            var2 = this.i + this.h - this.v.h() * (float)Math.cos(var4);
         }

         switch(this.p) {
         case 0:
            var3 = this.j + this.g;
            break;
         case 1:
            var3 = this.j + (this.g + this.v.i() * (float)Math.cos(var4) + this.v.h() * (float)Math.sin(var4)) / 2.0F;
            break;
         case 9:
            var3 = this.j + this.v.i() * (float)Math.cos(var4) + this.v.h() * (float)Math.sin(var4);
            break;
         default:
            var3 = this.j + this.g - (this.v.i() * (float)Math.cos(var4) - this.v.h() * (float)Math.sin(var4)) / 2.0F;
         }

         var1.a(new com.aspose.cells.b.a.b.a.zi(1.0F * this.K, 0.0F, 0.0F, 1.0F * this.K, 0.0F, 0.0F));
         var1.a().b(var2, var3, 1);
      }

   }

   public void b(com.aspose.cells.a.d.zb var1) {
      float var2 = 0.0F;
      var1.a((com.aspose.cells.b.a.b.a.zi)null);
      if (this.r >= -1.4E-45F && this.r <= Float.MIN_VALUE) {
         var2 = 0.0F;
         var1.a(new com.aspose.cells.b.a.b.a.zi(1.0F * this.K, 0.0F, 0.0F, 1.0F * this.K, 0.0F, 0.0F));
         var1.a().b(this.v.j(), this.v.m(), 1);
         this.K = 1.0F;
      } else {
         var2 = -this.r;
         var1.a(new com.aspose.cells.b.a.b.a.zi(1.0F * this.K, 0.0F, 0.0F, 1.0F * this.K, 0.0F, 0.0F));
         var1.a().a(var2, new com.aspose.cells.b.a.b.zo(0.0F, 0.0F));
      }

   }

   private void a(float var1, float var2, float[] var3, float[] var4) {
      float var5 = var1 - var2;
      var3[0] = 0.0F;
      var4[0] = 0.0F;
      if (var5 > 0.0F) {
         int var6 = this.D.h().getColumn();
         int var7 = this.D.h().getRow();
         int var8 = var6 - 1;
         zp var10 = this.D.h().b.a;
         zfv var11 = new zfv();
         float var9;
         zfv var12;
         zahl var13;
         int var14;
         int var15;
         if (var8 >= 0) {
            var13 = var10.a(-1, this.D.h().a, true);
            var13.a();
            var14 = var13.a();
            var15 = -1;
            if (var14 > -1) {
               var15 = var10.a(var14);
            }

            do {
               if (var8 == var15) {
                  var12 = var10.c(var14, var11);
                  if (!var12.b()) {
                     break;
                  }

                  var14 = var13.a();
                  if (var14 > -1) {
                     var15 = var10.a(var14);
                  }
               }

               var9 = (float)(this.y.c.b(var8) * 72.0D * this.F[0]);
               if (var5 < var9) {
                  var3[0] += var5;
                  break;
               }

               var3[0] += var9;
               var5 -= var9;
               --var8;
            } while(var8 >= 0);
         }

         var8 = var6 + this.D.m();
         if (var8 < 16383) {
            var5 = (var1 - var2) / 2.0F + 1.0F;
            var13 = var10.a(this.D.h().a + this.D.m() - 1, -1, false);
            var13.a();
            var15 = -1;
            var14 = var13.a();
            if (var14 > -1) {
               var15 = var10.a(var14);
            }

            do {
               if (var15 == var8) {
                  var12 = var10.c(var14, var11);
                  if (!var12.b()) {
                     break;
                  }

                  var14 = var13.a();
                  if (var14 > -1) {
                     var15 = var10.a(var14);
                  }
               }

               var9 = (float)(this.y.c.b(var8) * 72.0D * this.F[0]);
               if (var5 < var9) {
                  var4[0] += var5;
                  break;
               }

               var4[0] += var9;
               var5 -= var9;
               ++var8;
            } while(var8 < 16383);
         }

      }
   }

   private void n() throws Exception {
      boolean var1 = this.D.t();
      if (!this.D.a && this.D.c().getRotationAngle() != 255 && (var1 || this.D.g() != 8 || this.D.i() != 1 && this.D.i() != 4)) {
         zgd.a(this.E, var1);
      } else {
         zgd.a(this.E);
      }

      if (this.n) {
         Iterator var2 = this.E.iterator();

         while(var2.hasNext()) {
            zot var3 = (zot)var2.next();
            if (var3.b != null) {
               var3.b.setColor(Color.getBlack());
            }
         }
      }

      zbmg var10 = (zbmg)this.Q.h.get(this.y.h().m());
      float var11 = var10.a;
      this.R = new zgf(this.E, this.D, (float)this.k * (float)this.F[0], (float)this.l * (float)this.F[1], var11, this.F, var1);
      this.R.k = this.t;
      this.B = new com.aspose.cells.a.d.zb();
      this.R.a(this.B);
      this.m();
      if (this.z) {
         com.aspose.cells.a.d.zi var4 = new com.aspose.cells.a.d.zi(this.v, com.aspose.cells.b.a.zv.a(this.A, "\\", "/"));
         this.G.a((com.aspose.cells.a.d.zl)var4);
         this.z = false;
      }

      com.aspose.cells.a.d.zb var12 = new com.aspose.cells.a.d.zb();
      this.b(this.B);
      this.a(var12);
      var12.a((com.aspose.cells.a.d.zl)this.B);
      float var5 = 0.0F;
      float var6 = 0.0F;
      if (this.q == 1 && !this.D.n()) {
         float[] var8 = new float[]{var5};
         float[] var9 = new float[]{var6};
         this.a(this.v.h(), this.h, var8, var9);
         var5 = var8[0];
         var6 = var9[0];
      }

      com.aspose.cells.b.a.b.zq var7 = new com.aspose.cells.b.a.b.zq(this.i - var5 + 0.25F, this.j + 0.25F, this.h + var5 + var6 - 0.5F, this.g - 0.5F);
      if (this.L) {
         var12.a((com.aspose.cells.a.d.zam)null);
      } else if (this.r == 0.0F || this.r == 90.0F || this.r == -90.0F) {
         var12.a(new com.aspose.cells.a.d.zam(var7, this.y.h().getDisplayRightToLeft()));
      }

      if (this.r != 0.0F && this.r != 90.0F && this.r != -90.0F) {
         this.G.a((com.aspose.cells.a.d.zl)var12);
      } else {
         com.aspose.cells.a.d.zb var13 = new com.aspose.cells.a.d.zb();
         var13.a(new com.aspose.cells.a.d.zn(var7));
         var13.a((com.aspose.cells.a.d.zl)var12);
         this.G.a((com.aspose.cells.a.d.zl)var13);
      }

   }

   void i() {
      this.C = new com.aspose.cells.a.d.zb();
      if (this.S == null) {
         this.S = new com.aspose.cells.a.d.zfj();
      }

   }

   public void a(com.aspose.cells.a.d.zl var1) {
      this.C.a((com.aspose.cells.a.d.zl)var1);
   }

   public void a(com.aspose.cells.b.a.d.zm var1) {
      com.aspose.cells.a.d.zj var2 = com.aspose.cells.a.d.zj.a(new com.aspose.cells.b.a.b.zo(this.i + this.w, this.j + this.x), new com.aspose.cells.b.a.b.zt(this.h, this.g), var1);
      com.aspose.cells.b.a.b.zq var3 = new com.aspose.cells.b.a.b.zq(this.i + this.w, this.j + this.x, this.h, this.g);
      if (this.D != null) {
         if (this.L) {
            this.C.a((com.aspose.cells.a.d.zam)null);
         } else {
            this.C.a(new com.aspose.cells.a.d.zam(var3, this.y.h().getDisplayRightToLeft()));
         }
      } else {
         this.C.a((com.aspose.cells.a.d.zl)var2);
      }

   }

   public void j() {
      for(int var1 = 0; var1 < this.S.a(); ++var1) {
         com.aspose.cells.a.d.zb var2 = new com.aspose.cells.a.d.zb();
         com.aspose.cells.a.d.zj var3 = (com.aspose.cells.a.d.zj)this.S.c(var1);
         var2.a((com.aspose.cells.a.d.zl)var3);
         var2.a(var3.a);
         this.C.a((com.aspose.cells.a.d.zl)var2);
      }

      this.a.a((com.aspose.cells.a.d.zl)this.C);
      this.S = new com.aspose.cells.a.d.zfj();
   }

   void k() throws Exception {
      if (this.D.b != null && this.D.b.size() > 0) {
         com.aspose.cells.b.a.b.zq var1 = new com.aspose.cells.b.a.b.zq(this.i, this.j, this.h, this.g);
         String[] var2 = T;
         int var3 = var2.length;

         for(int var4 = 0; var4 < var3; ++var4) {
            String var5 = var2[var4];
            zagm var6 = (zagm)this.D.b.get(var5);
            if (var6 != null) {
               com.aspose.cells.a.d.zb var7 = var6.a(var1, this.F, this.q, this.p);
               if (var7 != null) {
                  this.H.a((com.aspose.cells.a.d.zl)var7);
                  if (!var6.c() && this.D.r() != null) {
                     this.D.r().clear();
                  }
               }
            }
         }
      }

   }

   private boolean a(zdb var1, zdb var2) {
      if (var1.b() == 0 && var1.a() == N) {
         return false;
      } else {
         Object var3 = O.get(var2.b());
         Object var4 = O.get(var1.b());
         if (var3 != null && var4 != null) {
            if ((Integer)var3 < (Integer)var4) {
               return false;
            } else {
               return (Integer)var3 == (Integer)var4 ? this.a(var1.c(), var2.c()) : true;
            }
         } else {
            return false;
         }
      }
   }

   private boolean a(Color var1, Color var2) {
      if (var1.getR() == var2.getR() && var1.getG() == var2.getG() && var1.getB() == var2.getB()) {
         return false;
      } else {
         return this.b(var1) > this.b(var2);
      }
   }

   private double b(Color var1) {
      return Math.sqrt((double)(var1.getR() & 255 ^ 2) * 0.299D + (double)(var1.getG() & 255 ^ 2) * 0.587D + (double)(var1.getB() & 255 ^ 2) * 0.114D);
   }

   private void a(boolean var1, int var2, com.aspose.cells.a.d.zl var3, int var4, Color var5) {
      if (var1) {
         this.M.put(var2, new zdb(N, 0, Color.getEmpty()));
      } else {
         zdb var6 = new zdb(var3, var4, var5);
         if (this.M.containsKey(var2)) {
            zdb var7 = (zdb)this.M.get(var2);
            if (this.a(var7, var6)) {
               this.M.put(var2, var6);
            }
         } else {
            this.M.put(var2, var6);
         }

      }
   }

   static {
      if (O == null) {
         Object var0 = P;
         synchronized(P) {
            if (O == null) {
               O = new HashMap();
               O.put(0, 0);
               O.put(7, 1);
               O.put(11, 2);
               O.put(9, 3);
               O.put(4, 4);
               O.put(3, 5);
               O.put(1, 6);
               O.put(12, 7);
               O.put(13, 8);
               O.put(10, 9);
               O.put(8, 10);
               O.put(2, 11);
               O.put(5, 12);
               O.put(6, 13);
            }
         }
      }

   }
}
